


import { ipcRenderer } from "electron";

export interface DamaResult {
    success: boolean;
    code?: string;
    taskId?: string;
    errorMsg?: string;
    usedTime?: number;
}

const damaApi = {
    
    getCode: (base64Image: string): Promise<DamaResult> => ipcRenderer.invoke('dama:get-code', base64Image),

    reportError: (taskId: string): Promise<boolean> => ipcRenderer.invoke('dama:report-error', taskId),

    usePlatform: (platformName: string): Promise<{ success: boolean; error?: string }> => ipcRenderer.invoke('dama:use-platform', platformName),
}

export default damaApi;